// 引入封装的post和get
import {get,post} from '../../utils/request.js'
const state = {
  //用来保存查询出来的栏目信息
  accounts:[],
  total:0
}
  
const actions = {
// 查询所有评论信息
findAllAccounts(context,list){
  // 异步操作
  get('/accountApply/pageQueryAccountApply',list).then(res =>{
    console.log(res,"@@@@@@@@@@@");
    let response = res.data.list
    let total = res.data.total
    context.commit('SET_ACCOUNTS',response)
    context.commit('SET_TOTAL',total)
  })
},
// 通过
aduitPass(context,list){
  let response = get('/accountApply/checkPass',list)
  return response
},
// 不通过
aduitNoPass(context,list){
  let response = get('/accountApply/checkNoPass',list)
  return response
},
}
 
const mutations = {
//修改state中的值
SET_ACCOUNTS(state,response){
  state.accounts = response
},
SET_TOTAL(state,total){
  state.total = total
}
}

export default {
  namespaced:true,
  state,
  actions,
  mutations
}